/*
*
@file		types.h
*
*/

#ifndef __TYPE_H__
#define __TYPE_H__


#include <avr/io.h>
#include <avr/pgmspace.h>


#ifndef NULL
#define NULL		((void *) 0)
#endif

typedef enum { false, true } bool;

#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned int size_t;
#endif

/**
 * The 8-bit signed data type.
 */
typedef char int8;
/**
 * The volatile 8-bit signed data type.
 */
typedef volatile char vint8;
/**
 * The 8-bit unsigned data type.
 */
typedef unsigned char uint8;
/**
 * The volatile 8-bit unsigned data type.
 */
typedef volatile unsigned char vuint8;

/**
 * The 16-bit signed data type.
 */
typedef int int16;
/**
 * The volatile 16-bit signed data type.
 */
typedef volatile int vint16;
/**
 * The 16-bit unsigned data type.
 */
typedef unsigned int uint16;
/**
 * The volatile 16-bit unsigned data type.
 */
typedef volatile unsigned int vuint16;
/**
 * The 32-bit signed data type.
 */
typedef long int32;
/**
 * The volatile 32-bit signed data type.
 */
typedef volatile long vint32;
/**
 * The 32-bit unsigned data type.
 */
typedef unsigned long uint32;
/**
 * The volatile 32-bit unsigned data type.
 */
typedef volatile unsigned long vuint32;

/* bsd */
typedef uint8			u_char;		/**< 8-bit value */
typedef uint16			u_short;	/**< 16-bit value */
typedef uint16			u_int;		/**< 16-bit value */
typedef uint32			u_long;		/**< 32-bit value */


typedef unsigned long long  u64; 
typedef unsigned long  u32;
typedef unsigned short u16;
typedef unsigned char  u8;

typedef signed long long   s64; 
typedef signed long    s32;
typedef signed short   s16;
typedef signed char    s8;

//typedef unsigned char       uint8;   //8 bits
//typedef unsigned short      uint16;  //16 bits
//typedef unsigned long       uint32;  //32 bits
typedef unsigned long long  uint64;  //64 bits


//typedef signed char         int8;    //8 bits
//typedef signed short        int16;   //16 bits
//typedef signed long         int32;   //32 bits
typedef signed long long    int64;   //64 bits

typedef union _un_l2cval {
	u_long	lVal;
	u_char	cVal[4];
}un_l2cval;

typedef union _un_i2cval {
	u_int	iVal;
	u_char	cVal[2];
}un_i2cval;


#endif		// __TYPE_H__
